<template>
  <div>
    <tb-report
      :schemas="schemas"
      :columns="columns"
      :apiUrl="apiUrl"
      :getData="getData"
      :tableData="tableData"
    ></tb-report>
  </div>
</template>

<script>
import TbReport from "@/components/tb-report/index.vue";

export default {
  name: "App",
  components: { TbReport },
  data() {
    return {
      title: "首页",
      apiUrl:"/scm/api/v1/scmStandingBook/exportQueryByPage",
      schemas: [
        {
          label: "内贸合同号",
          field: "contractNo",
          component: "Input",
          placeholder: "内贸合同号",
          required: false,
          colProps: {},
        },
        {
          label: "批次号",
          field: "batchNo",
          component: "Input",
          placeholder: "批次号",
          required: false,
          colProps: {},
        },
      ],
      columns: [
        {
          title: "序号",
          fixed: 'left', 
          type: "seq",
          width: 60,
          align: "center",
        },
        { key: 'contractNo', title: '内贸合同号', field: 'contractNo', width: 200, },
    {
      title: '批次号',
      field: 'batchNo',
      width: 200,
    },
    { key: 'supplier', title: '供应商名称', field: 'supplier' ,width: 200,},
    { key: 'programNumber', title: '项目编号', field: 'programNumber',width: 200, },
    { key: 'programName', title: '项目名称', field: 'programName',width: 200, },
    { key: 'programCustomer', title: '项目客户', field: 'programCustomer',width: 200, },
    { key: 'purchaser', title: '采购业务员', field: 'purchaser',width: 200, },
    {
      key: 'earlyGuidance',
      title: '是否提前指导',
      field: 'earlyGuidance',
      width: 200,
    },
    {
      key: 'checkFlag',
      title: '是否免检',
      field: 'checkFlag',
      width: 200,
    },

    { key: 'inspectorName', title: '检验员', field: 'inspectorName', width: 200 },
    { key: 'expeditorName', title: '催交员', field: 'expeditorName', width: 200 },
    { key: 'inspectorManagerName', title: '监造经理', field: 'inspectorManagerName', width: 200 },
    {
      key: 'contractCategory',
      title: '类别',
      field: 'contractCategory',
      width: 200,
    },

    {
      key: 'deliveryDate',
      title: '合同交货日期',
      field: 'deliveryDate',
      width: 200,
    },
    // 合并

    {
      key: 'priorityStowageFlag',
      title: '优先配载',
      field: 'priorityStowageFlag',
      width: 120,
    },
    {
      key: 'priorityStowageDate',
      title: '优先配载日期',
      field: 'priorityStowageDate',
      width: 120,
    },
    {
      key: 'storageTransportationStatus',
      title: '状态',
      field: 'storageTransportationStatus',
      width: 150,
    },
    {
      key: 'planDeliveryDate',
      title: '预计交货日期',
      field: 'planDeliveryDate',
      width: 120,
    },
    {
      key: 'packingListRequiredDeliveryDate',
      title: '箱单要求提交日期',
      field: 'packingListRequiredDeliveryDate',
      width: 150,
    },
    {
      key: 'packingListSubmissionDeliveryDate',
      title: '箱单实际提交日期',
      field: 'packingListSubmissionDeliveryDate',
      width: 150,
    },
    {
      key: 'packingListOverdueDays',
      title: '箱单逾期天数',
      field: 'packingListOverdueDays',
      width: 100,
    },
    {
      key: 'packagingCompletionDate',
      title: '包装完成日期',
      field: 'packagingCompletionDate',
      width: 120,
    },
    {
      key: 'packingTime',
      title: '要求包装完成日期',
      field: 'packingTime',
      width: 150,
    },
    {
      key: 'overdueDays',
      title: '包装逾期天数',
      field: 'overdueDays',
      width: 120,
    }
      ],
      tableData:[]
    };
  },
  methods:{
    getData(data){
           if (this.tableData.length == 0) {
            this.tableData = data;
           } else {
            this.tableData = [...this.tableData, ...data];
          }
    }
  }
};
</script>

<style>
</style>
